﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
    <p>All files are generated in the output directory. Usually this is bin/debug or 
        bin/release.</p>
    <h4>CMAP file</h4>
    <p>The CMAP file maps assembler labels to physical memory locations. These labels 
    include data (internal data, static fields, string literals) and code locations 
    (method entry, points for each line of code, internal locations for exception 
    handling).</p>
    <p><strong><em>Is CMAP used any more? Cant find any reference to it in code.</em></strong></p>
    <p>The format is:</p>
    <ol>
        <li>Address</li>
        <li>Tab</li>
        <li>Label</li>
    </ol>
    <p>Example:</p>
    <pre>00500000 DebugTraceMode
00500004 DebugStatus
00500008 DebugRunning </pre>
    <h4>
        CXDB file</h4>
    <p>
        The CXDB contains a series of records with information about the methods. Each 
        record contains:</p>
    <ul>
        <li>LabelName (string) - Label as used in the ASM file to start the method. Each 
            label emitted exists, that is many labels for each method.</li>
        <li>Address (uint) - Address in physical memory.</li>
        <li>StackDifference (int) - Size of stack. Arguments only?</li>
        <li>AssemblyFile (string) - .NET assmebly containing IL source.</li>
        <li>TypeToken (int) - .NET token for the containing type.</li>
        <li>MethodToken (int) - .NET token for the method.</li>
        <li>ILOffset (int) - Offset into the .NET assembly file where the method resides.</li>
        <li>MethodName (string) - Name of the method. Not unique, as many labels exist per 
            method.</li>
    </ul>
    Cosmos.Debug.Common.SourceInfos is a class for reading the CXDB file 
    (and the PDB too). Currently the CXDB is handled by a dataset and saved as an 
    XML file. However we never need the whole file in RAM, and in the future it 
    should be changed to a database such as embedded Firebird (SQL Express has size 
    limits we could forseeably encounter although in newer versions the limits have 
    been raised).<h4>
        ASM file</h4>
    <p>
        The ASM file is actually generated by the Cosmos compiler, however in some cases 
        it can be useful to the debugger. Most notably to display the assembly during 
        interaction with GDB, or the given assembly for .NET code. Currently it is only 
        used by the Cosmos GDB client, however there are plans to integrate assembly 
        view and GDB debugging into Visual Studio.</p>
    <h4>
        PDB files</h4>
    <p>
        PDB files are debug files generated by the .NET compiler. (<a 
            href="http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/05/11/pdb-files-what-every-developer-must-know.aspx">More 
        info</a>, although its summed up as &quot;A .NET PDB only contains two pieces of 
        information, the source file names and their lines and the local variable names. 
        All the other information is already in the .NET metadata so there is no need to 
        duplicate the same information in a PDB file. &quot;)</p>
    <p>
        PDB maps methods to source file locations. Given a method name, the source file 
        and exact start and end locations can be determined. It also contains 
        &quot;SequencePoints&quot; which map to individual source code lines in a source file.</p>
    <h4>
        LOG.html</h4>
    <p>
        If logging is enabled, a log file containting the scan tree used by the Cosmos 
        compiler will be generated.</p>

</body>
</html>
